import request from '../utils/request'

export function getContentList (data) {
  return request({
    url: '/content/getList',
    data: data,
    method: 'post'
  })
}

export function getContentDetail (id) {
  let data = {}
  if (typeof id === 'string') {
    data.id = id
  } else {
    data = id
  }
  return request({
    url: '/content/detail',
    data: data,
    method: 'post'
  })
}

export function getContentEdit (id) {
  return request({
    url: '/content/edit',
    data: {
      id: id
    },
    method: 'post'
  })
}

export function updateContent (form) {
  return request({
    url: '/content/update',
    data: form,
    method: 'POST'
  })
}

export function createContent (form) {
  return request({
    url: '/content/create',
    data: form,
    method: 'POST'
  })
}

export function getDictionary (code) {
  return request({
    url: '/dictionary/getList',
    data: {
      code: code
    },
    method: 'post'
  })
}
